<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateProductsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('products', function (Blueprint $table) {
            $table->id();
            $table->string('name')->comment('名称');
            $table->string('preview')->comment('预览图');
            $table->json('images')->comment('详情图');
            $table->decimal('price')->comment('价格');
            $table->integer('user_id')->comment('用户');
            $table->decimal('integral')->default(0)->comment('积分');
            $table->decimal('increase')->default(0)->comment('增幅价格');
            $table->boolean('transfer')->default(0)->comment('是否转让');
            $table->boolean('pick')->default(0)->comment('是否提货');
            $table->boolean('status')->default(1)->comment('状态');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('products');
    }
}
